<%-- 
    Document   : gomodifystu
    Created on : 2013-5-10, 14:52:58
    Author     : Sam.Zheng <zcl1866@sina.com>
--%>

<%String path = request.getContextPath();%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>修改信息</title>
    </head>
    <body>
        <div style="margin-top: 20px;margin-left: 20px;">
            <div>
                <label for="name">学生姓名</label>
                <input class="easyui-validatebox" id="s_name" type="text" value="${stu.name}" name="name" data-options="required:true"></input>
                <input type ="hidden" name="id" value="${stu.id}" />
            </div>
            <div  style="padding-top: 10px">
                <label for="className">选择年级</label>
                <select id="className" name="className" >
                    ${options}
                </select>
            </div>
            <div style="padding-top: 20px;text-align: center">
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">保存</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" onclick="closeDialog()">取消</a>
                <script>
                       function submitForm(){
                           var id = ${stu.id};
                           var name = $("#s_name").val();
                           var cla_id = $("#className").val();
                           var xx = {"id":cla_id};
                           var json = {id:id,name:name,s_class:xx};
                           $.ajax({
                               url:"<%=path%>/app/index/doModfiyStu",
                               type:"post",
                               data:  $.toJSON(json),
                               contentType: "application/json",
                               success : function (msg){
                                   if(msg == 1){
                                       win.alert("提示", "修改成功");
                                       location.reload();
                                   }else{
                                       win.alert("提示", "修改失败","error");
                                   }
                               }
                           });
                       }
                       function closeDialog(){
                           win.close("modfiyStu");
                       }
        
      
        
                </script>  
            </div>

        </div>
    </body>

</html>
